package rpg.data;

import java.io.File;

import org.jdom.Element;

import pedrosm.data.ScriptData;

import square.data.DataGroup;

/**
 * 
 * @author Pedro Silva Moreira
 */
public class ScriptXML implements LoaderXML {
	private static ScriptXML singleton = new ScriptXML();
	
	// Creation
	private ScriptXML() {
	}
	
	// Instance
	public static ScriptXML instance() {
		return singleton;
	}
	
	// Load
	@Override
	public void load(String group, String name, Element origin) {
		ScriptData<?> script = new ScriptData<Object>(name, group, XML.DATA_FOLDER + "scripts"
				+ File.separator + group + File.separator + name + ".groovy");
		DataGroup.getScripts().add(script);
	}
}
